import request from '@/utils/request'

// 获取分类知识列表
export function getKnowledgeList(categoryId) {
  return request({
    url: `/v1/medical/knowledge/show/${categoryId}`,
    method: 'get'
  })
}

// 分页查询知识
export function getKnowledgePage(params) {
  return request({
    url: '/v1/medical/knowledge/page',
    method: 'get',
    params
  })
}

// 获取知识详情
export function getKnowledgeDetail(id) {
  return request({
    url: `/v1/medical/knowledge/detail/${id}`,
    method: 'get'
  })
}

// 添加知识
export function addKnowledge(data) {
  return request({
    url: '/v1/medical/knowledge/add',
    method: 'post',
    data
  })
}

// 更新知识
export function updateKnowledge(data) {
  return request({
    url: '/v1/medical/knowledge/update',
    method: 'post',
    data
  })
}

// 删除知识
export function deleteKnowledge(id) {
  return request({
    url: `/v1/medical/knowledge/delete/${id}`,
    method: 'delete'
  })
}

// 批量删除知识
export function batchDeleteKnowledge(ids) {
  return request({
    url: '/v1/medical/knowledge/batch/delete',
    method: 'post',
    data: ids
  })
} 